Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 예약 API Request Body 및 서비스 로직 리팩토링 #99

Merged
merged 14 commits into from
Dec 12, 2023

Conversation

jo0oy
Copy link
Contributor

@jo0oy jo0oy commented Dec 6, 2023

💡 Motivation

  • 예약 API Request Body의 불필요한 필드를 제거하고 예약 저장 서비스 로직을 리팩토링합니다.

📌 Changes

  • ReservationProductRequestDto에 예약시 불필요한 필드 모두 제거
  • Entity를 원하는 Dto로 변환하는 ReservationMapper 유틸 클래스 추가
  • ReservationService에 ReservationMapper를 적용하고 코드 리팩토링
  • Request Body와 서비스 로직 수정에 따른 Test 수정 및 정상 동작 확인

🫱🏻‍🫲🏻 To Reviewers

  • 예약 API의 Request Body를 수정하고 예약 서비스 로직을 리팩토링 했습니다!!

This close #97

@jo0oy jo0oy added 🚧refactoring 리팩토링 ✅Test test 관련 labels Dec 6, 2023
@jo0oy jo0oy self-assigned this Dec 6, 2023
Copy link

github-actions bot commented Dec 6, 2023

Test Results

81 tests  ±0   81 ✔️ ±0   4s ⏱️ ±0s
46 suites ±0     0 💤 ±0 
46 files   ±0     0 ±0 

Results for commit c28d038. ± Comparison against base commit 6fe9b91.

♻️ This comment has been updated with latest results.

# Conflicts:
#	src/main/java/com/fc/shimpyo_be/domain/reservation/service/ReservationService.java
#	src/test/java/com/fc/shimpyo_be/domain/reservation/unit/service/ReservationServiceTest.java
…class) 추가

- DatabaseCleanUp를 주입받아 사용하기 위해 @import(TestDBCleanerConfig.class) 추가
- @Sql 모두 제거하고 @beforeeach로 필요한 테스트 데이터 생성
- DatabaseCleanUp 사용하기 위해 @import(TestDBCleanerConfig.class) 추가
Copy link
Contributor

@JeongUijeong JeongUijeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니당~ 전체적으로 생성자를 통해 객체를 생성하는 것을 확인했습니다.

Record는 All Arguments Constructor를 자동으로 생성하기 때문에, 나중에 필드 종류를 바꾸거나 순서만 바꿔도, 생성자가 쓰이고 있는 모든 곳을 수정하거나, 매번 생성자를 추가해서 새로운 All Args Constructor에게 전달해야 합니다!

Builder를 통해 객체를 생성하도록 수정하는 것이 좋을 것 같습니다~~

Copy link
Contributor

@wocjf0513 wocjf0513 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!!

@jo0oy jo0oy requested a review from JeongUijeong December 11, 2023 20:03
Copy link
Contributor

@JeongUijeong JeongUijeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨어용!!

@jo0oy jo0oy merged commit 8fe6e32 into develop Dec 12, 2023
3 checks passed
@jo0oy jo0oy deleted the feature/reservation-refactoring branch December 12, 2023 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧refactoring 리팩토링 ✅Test test 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants